﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Data.Objects.DataClasses;
using System.Runtime.Serialization;
using System.Xml.Serialization;
using System.ComponentModel;

namespace FinalProject.DAL.Model
{
    /// <summary>
    /// No Metadata Documentation available.
    /// </summary>
    [EdmEntityTypeAttribute(NamespaceName = "InvoiceModel", Name = "CollectionMoney")]
    [Serializable()]
    [DataContractAttribute(IsReference = true)]
    public partial class CollectionMoney : EntityObject
    {
        #region Factory Method

        /// <summary>
        /// Create a new CollectionMoney object.
        /// </summary>
        /// <param name="id">Initial value of the Id property.</param>
        /// <param name="amount">Initial value of the Amount property.</param>
        /// <param name="desciption">Initial value of the Desciption property.</param>
        /// <param name="invoiceDocumentId">Initial value of the InvoiceDocumentId property.</param>
        /// <param name="voucherId">Initial value of the VoucherId property.</param>
        public static CollectionMoney CreateCollectionMoney(global::System.Guid id, global::System.Decimal amount, global::System.String desciption, global::System.Guid invoiceDocumentId, global::System.Guid voucherId)
        {
            CollectionMoney collectionMoney = new CollectionMoney();
            collectionMoney.Id = id;
            collectionMoney.Amount = amount;
            collectionMoney.Desciption = desciption;
            collectionMoney.InvoiceDocumentId = invoiceDocumentId;
            collectionMoney.VoucherId = voucherId;
            return collectionMoney;
        }

        #endregion

        #region Primitive Properties

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty = true, IsNullable = false)]
        [DataMemberAttribute()]
        public global::System.Guid Id
        {
            get
            {
                return _Id;
            }
            set
            {
                if (_Id != value)
                {
                    OnIdChanging(value);
                    ReportPropertyChanging("Id");
                    _Id = StructuralObject.SetValidValue(value);
                    ReportPropertyChanged("Id");
                    OnIdChanged();
                }
            }
        }
        private global::System.Guid _Id;
        partial void OnIdChanging(global::System.Guid value);
        partial void OnIdChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty = false, IsNullable = false)]
        [DataMemberAttribute()]
        public global::System.Decimal Amount
        {
            get
            {
                return _Amount;
            }
            set
            {
                OnAmountChanging(value);
                ReportPropertyChanging("Amount");
                _Amount = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("Amount");
                OnAmountChanged();
            }
        }
        private global::System.Decimal _Amount;
        partial void OnAmountChanging(global::System.Decimal value);
        partial void OnAmountChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty = false, IsNullable = false)]
        [DataMemberAttribute()]
        public global::System.String Desciption
        {
            get
            {
                return _Desciption;
            }
            set
            {
                OnDesciptionChanging(value);
                ReportPropertyChanging("Desciption");
                _Desciption = StructuralObject.SetValidValue(value, false);
                ReportPropertyChanged("Desciption");
                OnDesciptionChanged();
            }
        }
        private global::System.String _Desciption;
        partial void OnDesciptionChanging(global::System.String value);
        partial void OnDesciptionChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty = false, IsNullable = false)]
        [DataMemberAttribute()]
        public global::System.Guid InvoiceDocumentId
        {
            get
            {
                return _InvoiceDocumentId;
            }
            set
            {
                OnInvoiceDocumentIdChanging(value);
                ReportPropertyChanging("InvoiceDocumentId");
                _InvoiceDocumentId = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("InvoiceDocumentId");
                OnInvoiceDocumentIdChanged();
            }
        }
        private global::System.Guid _InvoiceDocumentId;
        partial void OnInvoiceDocumentIdChanging(global::System.Guid value);
        partial void OnInvoiceDocumentIdChanged();

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [EdmScalarPropertyAttribute(EntityKeyProperty = false, IsNullable = false)]
        [DataMemberAttribute()]
        public global::System.Guid VoucherId
        {
            get
            {
                return _VoucherId;
            }
            set
            {
                OnVoucherIdChanging(value);
                ReportPropertyChanging("VoucherId");
                _VoucherId = StructuralObject.SetValidValue(value);
                ReportPropertyChanged("VoucherId");
                OnVoucherIdChanged();
            }
        }
        private global::System.Guid _VoucherId;
        partial void OnVoucherIdChanging(global::System.Guid value);
        partial void OnVoucherIdChanged();

        #endregion

        #region Navigation Properties

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("InvoiceModel", "InvoiceDocumentCollectionMoney", "InvoiceDocument")]
        public InvoiceDocument InvoiceDocument
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<InvoiceDocument>("InvoiceModel.InvoiceDocumentCollectionMoney", "InvoiceDocument").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<InvoiceDocument>("InvoiceModel.InvoiceDocumentCollectionMoney", "InvoiceDocument").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<InvoiceDocument> InvoiceDocumentReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<InvoiceDocument>("InvoiceModel.InvoiceDocumentCollectionMoney", "InvoiceDocument");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<InvoiceDocument>("InvoiceModel.InvoiceDocumentCollectionMoney", "InvoiceDocument", value);
                }
            }
        }

        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [XmlIgnoreAttribute()]
        [SoapIgnoreAttribute()]
        [DataMemberAttribute()]
        [EdmRelationshipNavigationPropertyAttribute("InvoiceModel", "VoucherCollectionMoney", "Voucher")]
        public Voucher Voucher
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Voucher>("InvoiceModel.VoucherCollectionMoney", "Voucher").Value;
            }
            set
            {
                ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Voucher>("InvoiceModel.VoucherCollectionMoney", "Voucher").Value = value;
            }
        }
        /// <summary>
        /// No Metadata Documentation available.
        /// </summary>
        [BrowsableAttribute(false)]
        [DataMemberAttribute()]
        public EntityReference<Voucher> VoucherReference
        {
            get
            {
                return ((IEntityWithRelationships)this).RelationshipManager.GetRelatedReference<Voucher>("InvoiceModel.VoucherCollectionMoney", "Voucher");
            }
            set
            {
                if ((value != null))
                {
                    ((IEntityWithRelationships)this).RelationshipManager.InitializeRelatedReference<Voucher>("InvoiceModel.VoucherCollectionMoney", "Voucher", value);
                }
            }
        }

        #endregion
    }
}
